<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>JSON Voorhees: jsonv::serializer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://www.mathjax.org/mathjax/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">JSON Voorhees
   </div>
   <div id="projectbrief">Killer JSON for C++</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classjsonv_1_1serializer.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classjsonv_1_1serializer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">jsonv::serializer Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="group__Serialization.html">Serialization</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>A <code>serializer</code> holds the method for converting an arbitrary C++ type into a <code>value</code>.  
 <a href="classjsonv_1_1serializer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="serialization_8hpp_source.html">jsonv/serialization.hpp</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for jsonv::serializer:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
 <div class="center">
  <img src="classjsonv_1_1serializer.png" usemap="#jsonv::serializer_map" alt=""/>
  <map id="jsonv::serializer_map" name="jsonv::serializer_map">
<area href="classjsonv_1_1adapter.html" title="An adapter is both an extractor and a serializer. " alt="jsonv::adapter" shape="rect" coords="0,56,241,80"/>
<area href="classjsonv_1_1serializer__for.html" alt="jsonv::serializer_for&lt; T &gt;" shape="rect" coords="502,56,743,80"/>
<area href="classjsonv_1_1adapter__for.html" alt="jsonv::adapter_for&lt; optional&lt; T &gt; &gt;" shape="rect" coords="251,112,492,136"/>
<area href="classjsonv_1_1adapter__for.html" alt="jsonv::adapter_for&lt; TContainer &gt;" shape="rect" coords="251,168,492,192"/>
<area href="classjsonv_1_1adapter__for.html" alt="jsonv::adapter_for&lt; TEnum &gt;" shape="rect" coords="251,224,492,248"/>
<area href="classjsonv_1_1adapter__for.html" alt="jsonv::adapter_for&lt; TOptional &gt;" shape="rect" coords="251,280,492,304"/>
<area href="classjsonv_1_1adapter__for.html" alt="jsonv::adapter_for&lt; TPointer &gt;" shape="rect" coords="251,336,492,360"/>
<area href="classjsonv_1_1adapter__for.html" alt="jsonv::adapter_for&lt; TWrapper &gt;" shape="rect" coords="251,392,492,416"/>
<area href="classjsonv_1_1adapter__for.html" alt="jsonv::adapter_for&lt; T &gt;" shape="rect" coords="251,448,492,472"/>
<area href="classjsonv_1_1function__serializer.html" alt="jsonv::function_serializer&lt; T, FToJson &gt;" shape="rect" coords="502,112,743,136"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab66dee52dec1bbb163b1ba76e7243cee"><td class="memItemLeft" align="right" valign="top">virtual const std::type_info &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1serializer.html#ab66dee52dec1bbb163b1ba76e7243cee">get_type</a> () const =0</td></tr>
<tr class="memdesc:ab66dee52dec1bbb163b1ba76e7243cee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the run-time type this <code>serialize</code> knows how to encode.  <a href="#ab66dee52dec1bbb163b1ba76e7243cee">More...</a><br /></td></tr>
<tr class="separator:ab66dee52dec1bbb163b1ba76e7243cee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35dbf8b8a615aab006eb1b8f098a6191"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classjsonv_1_1value.html">value</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1serializer.html#a35dbf8b8a615aab006eb1b8f098a6191">to_json</a> (const <a class="el" href="classjsonv_1_1serialization__context.html">serialization_context</a> &amp;context, const void *from) const =0</td></tr>
<tr class="memdesc:a35dbf8b8a615aab006eb1b8f098a6191"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a <code>value</code> <em>from</em> the value in the given region of memory.  <a href="#a35dbf8b8a615aab006eb1b8f098a6191">More...</a><br /></td></tr>
<tr class="separator:a35dbf8b8a615aab006eb1b8f098a6191"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A <code>serializer</code> holds the method for converting an arbitrary C++ type into a <code>value</code>. </p>

<p>Definition at line <a class="el" href="serialization_8hpp_source.html#l00235">235</a> of file <a class="el" href="serialization_8hpp_source.html">serialization.hpp</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ab66dee52dec1bbb163b1ba76e7243cee"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual const std::type_info&amp; jsonv::serializer::get_type </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the run-time type this <code>serialize</code> knows how to encode. </p>
<p>Once this <code>serializer</code> is registered with a <code>formats</code>, it is not allowed to change. </p>

<p>Implemented in <a class="el" href="classjsonv_1_1adapter__for.html#a2b2f3795b0ec91f79504d9dd0b3d19bc">jsonv::adapter_for&lt; T &gt;</a>, <a class="el" href="classjsonv_1_1adapter__for.html#a2b2f3795b0ec91f79504d9dd0b3d19bc">jsonv::adapter_for&lt; TEnum &gt;</a>, <a class="el" href="classjsonv_1_1adapter__for.html#a2b2f3795b0ec91f79504d9dd0b3d19bc">jsonv::adapter_for&lt; TPointer &gt;</a>, <a class="el" href="classjsonv_1_1adapter__for.html#a2b2f3795b0ec91f79504d9dd0b3d19bc">jsonv::adapter_for&lt; TContainer &gt;</a>, <a class="el" href="classjsonv_1_1adapter__for.html#a2b2f3795b0ec91f79504d9dd0b3d19bc">jsonv::adapter_for&lt; TOptional &gt;</a>, <a class="el" href="classjsonv_1_1adapter__for.html#a2b2f3795b0ec91f79504d9dd0b3d19bc">jsonv::adapter_for&lt; optional&lt; T &gt; &gt;</a>, <a class="el" href="classjsonv_1_1adapter__for.html#a2b2f3795b0ec91f79504d9dd0b3d19bc">jsonv::adapter_for&lt; TWrapper &gt;</a>, and <a class="el" href="classjsonv_1_1serializer__for.html#a72493b3e3b31bd091e30feb52d36711c">jsonv::serializer_for&lt; T &gt;</a>.</p>

</div>
</div>
<a class="anchor" id="a35dbf8b8a615aab006eb1b8f098a6191"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classjsonv_1_1value.html">value</a> jsonv::serializer::to_json </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classjsonv_1_1serialization__context.html">serialization_context</a> &amp;&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>from</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Create a <code>value</code> <em>from</em> the value in the given region of memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>Extra information to help you encode sub-objects for your type, such as the ability to find other <code>formats</code>. It also tracks the progression of types in the encoding heirarchy, so any exceptions thrown will have <code>type</code> information in the error message. </td></tr>
    <tr><td class="paramname">from</td><td>The region of memory that represents the C++ value to convert to JSON. The pointer comes as the result of a <code>static_cast&lt;void*&gt;</code>, so performing a <code>static_cast</code> back to your type is okay. </td></tr>
  </table>
  </dd>
</dl>

<p>Implemented in <a class="el" href="classjsonv_1_1adapter__for.html#a7a26f2b656dd5cce61940ad8f269a077">jsonv::adapter_for&lt; T &gt;</a>, <a class="el" href="classjsonv_1_1adapter__for.html#a7a26f2b656dd5cce61940ad8f269a077">jsonv::adapter_for&lt; TEnum &gt;</a>, <a class="el" href="classjsonv_1_1adapter__for.html#a7a26f2b656dd5cce61940ad8f269a077">jsonv::adapter_for&lt; TPointer &gt;</a>, <a class="el" href="classjsonv_1_1adapter__for.html#a7a26f2b656dd5cce61940ad8f269a077">jsonv::adapter_for&lt; TContainer &gt;</a>, <a class="el" href="classjsonv_1_1adapter__for.html#a7a26f2b656dd5cce61940ad8f269a077">jsonv::adapter_for&lt; TOptional &gt;</a>, <a class="el" href="classjsonv_1_1adapter__for.html#a7a26f2b656dd5cce61940ad8f269a077">jsonv::adapter_for&lt; optional&lt; T &gt; &gt;</a>, <a class="el" href="classjsonv_1_1adapter__for.html#a7a26f2b656dd5cce61940ad8f269a077">jsonv::adapter_for&lt; TWrapper &gt;</a>, and <a class="el" href="classjsonv_1_1serializer__for.html#a1b5b587e8100ac45c2daa613096f0a1e">jsonv::serializer_for&lt; T &gt;</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>jsonv/<a class="el" href="serialization_8hpp_source.html">serialization.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>jsonv</b></li><li class="navelem"><a class="el" href="classjsonv_1_1serializer.html">serializer</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
